package org.flyby.api.daoImpl;

import com.google.common.collect.Maps;
import org.flyby.api.dao.CodeTableDataDao;
import org.flyby.api.persistence.CodeTableData;
import org.springframework.stereotype.Repository;

import java.util.HashMap;

@Repository
public class CodeTableDataDaoImpl extends BaseCommonDaoImpl<CodeTableData> implements CodeTableDataDao {

    @Override
    public CodeTableData findByTableHeaderCodeAndItemCode(String tableHeaderCode, String itemCode) {
        HashMap<String, Object> parameters = Maps.newHashMap();
        parameters.put("tableHeaderCode", tableHeaderCode);
        parameters.put("itemCode", itemCode);
        return executeFirstResultNamedQuery("CodeTableData.findByTableHeaderCodeAndItemCode", parameters);
    }
}
